package com.example.carrierapp.util;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.example.lb.fingerdemo.R;

public class ImageBinding {
    @BindingAdapter({"drawable"})
    public static void bindDrawable(ImageView imageView, int drawableId) {
        if (drawableId != -1)
            imageView.setImageResource(drawableId);
    }

    @BindingAdapter({"url"})
    public static void bindGoodsSource(ImageView imageView, String url) {
        GlideApp.with(imageView).load(url).placeholder(R.mipmap.icon_default_img).error(R.mipmap.icon_default_img).into(imageView);
    }

}
